package com.goddess.yeecolor.tools;

import android.app.Activity;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.goddess.yeecolor.R;
import com.goddess.yeecolor.activity.MyAppClient;

/**
 * Created by yeecolor on 17/1/11.
 */
public class ToastUtils {
    public static void toast(String content){
        android.widget.Toast.makeText(MyAppClient.getInstance(), content, android.widget.Toast.LENGTH_SHORT).show();
    }
    public static void setToast(String content,int rid, Activity mActivity){
        View view= LayoutInflater.from(mActivity).inflate(R.layout.dialog_collect,null);
        TextView textView= (TextView) view.findViewById(R.id.call_content);
        textView.setText(content);
        ImageView imageView= (ImageView) view.findViewById(R.id.collect_imageview);
        imageView.setImageResource(rid);
        Toast toastStart=new Toast(mActivity);
        toastStart.setGravity(Gravity.CENTER,0,0);
        toastStart.setDuration(Toast.LENGTH_SHORT);
        toastStart.setView(view);
        toastStart.show();
    }
    public static void setToastText(String content, Activity mActivity){
        View view= LayoutInflater.from(mActivity).inflate(R.layout.dialog_text,null);
        TextView textView= (TextView) view.findViewById(R.id.call_content);
        textView.setText(content);
        Toast toastStart=new Toast(mActivity);
        toastStart.setGravity(Gravity.CENTER,0,0);
        toastStart.setDuration(Toast.LENGTH_SHORT);
        toastStart.setView(view);
        toastStart.show();
    }
}
